package com.linwen.javase.desgin_pattern.BigTalkDesignPattenJAVACode._23解释器模式._1基本代码;

import java.util.ArrayList;

public class Test {

    public static void main(String[] args) {


        Context context = new Context();
        ArrayList<AbstractExpression> list = new ArrayList<AbstractExpression>();
        list.add(new TerminalExpression());
        list.add(new NonterminalExpression());
        list.add(new TerminalExpression());
        list.add(new TerminalExpression());

        for (AbstractExpression exp : list) {
            exp.interpret(context);
        }

    }
}








